//
//  CZModelGroup.m
//  itheima_寻宝之旅_4.5(OC)
//
//  Created by 肖祺 on 16/4/5.
//  Copyright © 2016年 肖祺. All rights reserved.
//

#import "CZModelGroup.h"
#import "CZModel.h"

@implementation CZModelGroup

+(instancetype)HeadWithDic:(NSDictionary *)dic{
    
  return [[self alloc]initWithDic:dic];
    
}
-(instancetype)initWithDic:(NSDictionary *)dic{
    
    if (self = [super init]) {
        

        self.setting = [CZModel Model:dic[@"setting"]];
    }
    
    return self;
    
}

+(NSArray *)Model{
    
    NSArray *array = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"Head.plist" ofType:nil]];
    
    NSMutableArray *arrayM = [NSMutableArray array];
    
    for (NSDictionary *fg in array) {
        
        CZModelGroup *group = [CZModelGroup HeadWithDic:fg];
        
//        group.setting = [CZModel Model:group.setting];
        
        [arrayM addObject:group];
        
    }
    
    return arrayM;
    
}

@end
